
package agentsSME;



import org.apache.poi.ss.formula.functions.T;

import otherOrganizations.GovernmentAgent;
import enviornment.RelationshipEdge;
import repast.simphony.space.graph.EdgeCreator;

/**
 * is used to create edges (i.e., relationships and contacts) in a network projection.
 * @author ggjp22
 *
 */
public class Networking implements EdgeCreator<RelationshipEdge<T>, T>{
    
	private String host;
	
    public Networking(String host) {
		this.setHost(host);
//		contacts =new Map<String, RelationshipEdge<SME>>());
	}
	
	@SuppressWarnings("rawtypes")
	@Override
	public Class<RelationshipEdge> getEdgeType() {
		// TODO Auto-generated method stub
		return RelationshipEdge.class;
	}
	@Override
	public RelationshipEdge<T> createEdge(T source, T target,
			boolean isDirected, double weight) {
		// TODO Auto-generated method stub
		return new RelationshipEdge<T>(source, target, isDirected);
	}
	
	public RelationshipEdge<SME> createSmeEdge(SME source, SME target,
			boolean isDirected, double weight){
		RelationshipEdge<SME> smeR;
		smeR = new RelationshipEdge<>(source, target, isDirected);
		return smeR;
	}
	/**
	 * creates relationships between government agents and SME agents.
	 * @param source 
	 * @param target
	 * @param isDirected
	 * @param weight
	 * @return
	 */
	public RelationshipEdge<Object> createPubSubEdge(GovernmentAgent source, SME target,
			boolean isDirected, double weight){
		RelationshipEdge<Object> pubsubEdge;
		pubsubEdge = new RelationshipEdge<Object>(source, target, isDirected);
		return pubsubEdge;
	}

	public String getHost() {
		return host;
	}

	public void setHost(String host) {
		this.host = host;
	}
/**
 * creates relationships ??????????
 * @param sme
 * @param target
 * @param isDirected
 * 
 * @return
 */
	public RelationshipEdge<Object> createOrganizationEdge(SME sme, Object target, boolean isDirected) {
		// TODO Auto-generated method stub
		RelationshipEdge<Object> smeR;
		smeR = new RelationshipEdge<>(sme, target, isDirected);
		return smeR;
	}
	
}
